Charles fought continually with the Ottoman Empire and its sultan, Suleiman the Magnificent. The defeat of Hungary at the Battle of Mohacs in 1526 "sent a wave of terror over Europe." The Muslim advance in Central Europe was halted at the Siege of Vienna in 1529.  Suleiman won the contest for mastery of the Mediterranean, in spite of Spanish victories such as the conquest of Tunis in 1535. The regular Ottoman fleet came to dominate the Eastern Mediterranean after its victories at Preveza in 1538 and Djerba in 1560 (shortly after Charles's death), which severely decimated the Spanish marine arm. At the same time, the Muslim Barbary corsairs, acting under the general authority and supervision of the sultan, regularly devastated the Spanish and Italian coasts, crippling Spanish trade and chipping at the foundations of Habsburg power.  In 1536 Francis I of France allied himself with Suleiman against Charles. While Francis was persuaded to sign a peace treaty in 1538, he again allied himself with the Ottomans in 1542 in a Franco-Ottoman alliance. In 1543 Charles allied himself with Henry VIII and forced Francis to sign the Truce of Crepy-en-Laonnois. Later, in 1547, Charles signed a humiliating treaty with the Ottomans to gain himself some respite from the huge expenses of their war.  Charles V made overtures to the Safavid Empire to open a second front against the Ottomans, in an attempt at creating a Habsburg-Persian alliance. Contacts were positive, but rendered difficult by enormous distances. In effect, however, the Safavids did enter in conflict with the Ottoman Empire in the Ottoman-Safavid War, forcing it to split its military resources.

Answer this question "What did Suleiman have going on" by extracting the answer from the text above.
Suleiman won the contest for mastery of the Mediterranean, in spite of Spanish victories such as the conquest of Tunis in 1535.